package ObjectArray;

/**
 * Created by sunwei on 2017/10/13
 * Time:14:43
 */
public class Person {

    private String firstName;
    private String lastName;
    private int age;

    /*
    构造函数
     */
    public Person(String firstName, String lastName, int age) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.age = age;
    }

    /*
    显示人的信息
     */
    public void displayPerson(){
        System.out.println("姓："+firstName);
        System.out.println("名字："+lastName);
        System.out.println("年龄："+age);
    }

    /*
    获取人的名字
     */
    public String getLastName() {
        return lastName;
    }
}
